#!/bin/sh
#
# Copyright (C) 2017-2019 Hamish Coleman
#
# Look up the given filename in the description file and output the
# text description
#
# FIXME
# - the description file is expected to be in the current dir

DESCRIPTIONS=Descriptions.txt

FILE="$1"
if [ -z "$1" ]; then
    echo need filename
    exit 1
fi

if ! LINE=$(grep -E "^$FILE " "$DESCRIPTIONS"); then
    echo "Unknown file $FILE"
    exit 1
fi

echo "$LINE" | perl -pe 's/^(\S+)\s+(\S+)\s+//'

